home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tricks of the Mac Game Programming Gurus
/
TricksOfTheMacGameProgrammingGurus.iso
/
More Source
/
C⁄C++
/
E-Z Progress Bar 1.0a
/
ProgressClass.h
< prev
Wrap
C/C++ Source or Header
|
1995-03-15
|
2KB
|
87 lines
#include "ChiselClass.h"
#include "Environ.h"
enum progressBarFlags { progressDefaults=-1, canCancel=2, chiselFrame=4, grayBack=8, chiselBar=16, fineChisel=32 };
#define wLeft 150
#define wTop 150
#define wRight wLeft+300
#define wBottom wTop+120
class ProgressClass {
protected:
WindowPtr theWindow;
Rect windowRect;
Rect controlRect;
Rect emptyBar;
Rect progressBar;
Rect frameBar;
float kBarWidth;
short kBarHeight;
float pBarWidth;
float minValue, maxValue;
float curValue;
short appleMenu, menu1, menu2, menu3, menu4, menu5, menu6, menu7, menu8;
short appleDivider;
RGBColor emptyColor, progressColor, windowColor;
Boolean cancel, chiselP, chiselF, grayWin, useRGB, chiselH;
ControlHandle cancelButton;
EventRecord theEvent;
ChiselClass frameChisel, progChisel, hairChisel;
Point textPoint;
Str255 progressText;
short maxCharWid;
void DrawProgressBar();
void DrawProgressText();
void DeselectItems(short menuID);
void SelectItems(short menuID);
void DimMenus();
void HiliteMenus();
void PositionElements(Str255 paramText);
void SetCancelButton(short controlID=0);
void ReplaceText(Str255 paramText);
void UpdateWindow();
public:
ProgressClass(short options=progressDefaults);
~ProgressClass();
void SetMinMax(short min, short max);
void SetControlID(short controlID);
void SetAppleMenu(short appleID);
void SetMenus(short m1=0, short m2=0, short m3=0, short m4=0, short m5=0, short m6=0, short m7=0, short m8=0);
void SetTexts(Str255 windowTitle, Str255 paramText);
void SetOptions(short options=progressDefaults);
void HideBarWindow();
void ShowBarWindow();
void SetBar(short current);
void SetBar(short current, Str255 paramText); // use to change text
void SetBar(float current); // use for fractional numbers
void SetBar(float current, Str255 paramText);
Boolean ReceivedEvent(Boolean *userCancel, Boolean *deactivate, WindowPtr *updateWindow);
void SetEmptyColor(RGBColor theColor);
void SetBarColor(RGBColor theColor);
void SetWindowColor(RGBColor theColor);
void SetBarHeight(short height);
void SetBarWidth(short width);
};